<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>相等运算符</title>
    <script>
        /* 
            相等运算符
                ==
                    相等运算符
                        使用相等运算符进行比较时，会转为相同类型（一般为数值）再比较。
                        NaN不会和任何值相等，包括它自身。
                        Null与undefined比较时，返回 true
                ===
                    全等运算符
                        它不会进行类型转换。

                !=
                    不相等

                ！==

        */
        let a = null, b = undefined;
        console.log(a == b) //true
        console.log(a === b) //fasle

        a = 1, b = "1.0";
        console.log(a == b) //true
        console.log(a === b) //false

        console.log(a != b) //false
        console.log(a !== b)    //true

        a = '1', b = '1.00';
        console.log(a == b)     //false     //这里比较了两个字符串之间的内容
        console.log(a === b)    //false    
        console.log(a!=b)   //true

        a = "a", b = "ab";
        console.log(a == b)  //false
        console.log(a === b)    //false
    </script>
</head>

<body>

</body>

</html>